# 计算生日是当年的第几天
import datetime


def main():
    year, month, day = map(int, input("输入出生年月2010-10-10：").split("-"))
    if check(year, month, day):
        cal_1(year, month, day)
        cal_2(year, month, day)
    else:
        print("输入不正确")


# 判断数据有效
def check(year: int, month: int, day: int):
    try:
        datetime.date(year, month, day)
        return True
    except:
        return False


# 判断闰年
def leap_yaer(year):
    if year % 4 == 0 and year % 100 != 0:
        return True
    else:
        return False


# 输出方法一
def cal_1(year, month, day):
    m_1 = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
    result = 0
    for item in range(month - 1):
        if leap_yaer(year):
            m_1[1] = 29

        result += m_1[item]
    result = result + day
    print(result)

# 输出方法二
def cal_2(year, month, day):
    birthday = datetime.date(year, month, day)
    lastyear = datetime.date(year-1, 12, 31)
    result = (birthday - lastyear).days
    print(result)


main()
